package com.xb.cloud.common.model;

/**
 * 
 * @ClassName: OrderStatus
 * @Description:订单状态
 * @author: 鲜备科技
 * @date: 2018年1月24日 下午5:19:13
 * 
 * @Copyright: 2018 www.xianbeitech.com Inc. All rights reserved.
 *
 */
public enum OrderStatus {
	PENDING_PAYMENT(10, "未支付"), //
	ALREADY_PAID(20, "已支付"),//

	;

	private final Integer code;
	private final String name;

	private OrderStatus(int code, String name) {
		this.code = code;
		this.name = name;
	}

	public Integer getCode() {
		return code;
	}

	public String getName() {
		return name;
	}

	public static OrderStatus getEnumByCode(Integer code) {
		for (OrderStatus p : OrderStatus.values()) {
			if (p.getCode() == code) {
				return p;
			}
		}
		return null;
	}
}
